package cn.xy.ymcc.feign;

import cn.xy.ymcc.domain.MessageEmail;
import cn.xy.ymcc.result.JSONResult;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class SendMessageFeignClientfallback implements FallbackFactory<SendMessageFeignClient> {
    @Override
    public SendMessageFeignClient create(Throwable throwable) {
        return new SendMessageFeignClient() {
            @Override
            public JSONResult save(MessageEmail messageEmail) {
                return JSONResult.error("系统繁忙");
            }
        };
    }
}